function success(msg) {
    new $.zui.Messager(msg, {
        type: 'success' // 定义颜色主题
    }).show();
}


var Formator = {
    errFormat:function errFormat(err){
        var rs = '' ;
        for(var k in err){
            rs += err[k].join(' ') ;
        }
        return rs ;
    }
}

function error(msg, format) {
    msg = format ? Formator[format](msg) : msg ;
    new $.zui.Messager(msg, {
        type: 'danger' // 定义颜色主题
    }).show();
}


function copyProperty(from,to) {
    for(var proto in from){
        to[proto] = from[proto]
    }
}

var zhttp = function () {
    return {
        post:function (url,data,success) {
            $.ajax({
                headers: {
                    Accept: "application/json; charset=utf-8"
                },
                url:url,
                dataType: "json",
                type: "POST",
                data:data,
                success: success
            });
        },
        get:function(url,data){
            return $.ajax({
                headers: {
                    Accept: "application/json; charset=utf-8"
                },
                url:url,
                dataType: "json",
                type: "GET",
                data:data,
                error:function (xhr,response,err) {
                    App.errorHander(xhr,response,err)
                }
            });
        }
    }
}()